const axios = require('axios');
const MyFormData = require('form-data');
const fs = require('fs');

let filePath = "D:\\hls_genrate\\my_genrator\\out\\1\\240p\\index0.ts";

var form = new MyFormData();
// 创建一个表单数据
form.append("type", "tv");
form.append("folder", '/testTV/1080p/');
form.append("file", fs.createReadStream(filePath));

let headers = form.getHeaders();
console.log(headers)
axios.post('https://tv.ailipai.net/Movie/uploadM3u8', form,{
    headers: headers
})
    .then(function (response) {
        console.log("response : ",response.data);
    })
    .catch(function (error) {
        console.log("error : ",error);
    });
